#define _CRT_SECURE_NO_WARNINGS 01
#include <stdio.h>

int main() {
    int a;
    while (scanf("%d", &a) != EOF) {
        char prin[32] = { 0 };
        int ret = 0;
        while (a != 0)
        {
            prin[ret++] = a % 10+'0';
            a = a / 10;
        }
        prin[ret] = '\0';
        printf("%s\n", prin);
    }
    return 0;
}

#include <stdio.h>
#include <string.h>
#include<ctype.h>

int main() {
    char arr[10001] = { 0 };
    char new[10001] = { 0 };
    gets(arr);
    int len = strlen(arr);
    int ren = len - 1;
    for (int i = 0; i < len; i++)
    {
        new[i] = arr[ren];
        ren--;
    }
    int ret = 0;
    while (new[ret])
    {
        if (isalpha(new[ret]))
        {
            printf("%c", new[ret++]);
        }
        else
        {
            while (new[ret] && !isalpha(new[ret]))
            {
                ret++;
            }
            printf(" ");
        }
    }

    return 0;
}